//
//  GBWeiboTableViewCell.m
//  PublicSentimentMonitorSystem
//
//  Created by 郭斌 on 15/11/5.
//  Copyright © 2015年 魏强. All rights reserved.
//

#import "GBWeiboTableViewCell.h"

@implementation GBWeiboTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        // Initialization code
        _titleLab = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, screenW - 20, 30)];
        _titleLab.numberOfLines = 1;
        _titleLab.font = [UIFont systemFontOfSize:15];
        
        _CancleBtn = [UIButton buttonWithType:0];
        _CancleBtn.frame = CGRectMake(screenW - 60, 5, 30, 30);
        _CancleBtn.titleLabel.font = [UIFont systemFontOfSize:15];
        [_CancleBtn setImage:[UIImage imageNamed:@"删除"] forState:UIControlStateNormal];
        //[_CancleBtn setTitle:@"删除" forState:UIControlStateNormal];
        
        [_CancleBtn addTarget:self action:@selector(cancelTheCell:) forControlEvents:UIControlEventTouchUpInside];
        [_CancleBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        
        [self.contentView addSubview:_titleLab];
        [self.contentView addSubview:_CancleBtn];
    }
    return self;
}

#pragma mark - 点击删除按钮操作
-(void)cancelTheCell:(UIButton *)sender
{
    NSString *tagString = [NSString stringWithFormat:@"%ld", (long)sender.tag];
    NSDictionary *userInfo11b = [[NSDictionary alloc] initWithObjectsAndKeys:tagString, @"deleteBtnTag",nil];
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"DeleteTheKeyword3" object:nil userInfo:userInfo11b];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
